﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using WCrawlerLib;
using System.Threading;
using System.Threading.Tasks;

namespace WCrawler
{
    public partial class _frmSeachForumPosts : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Panel pnlCommand = (Panel)ucForumControl.FindControl("pnlCommand");
                pnlCommand.Visible = false;

                GridView gridViewForums = (GridView)ucForumControl.FindControl("gridViewForums");
                CommandField cmdField = (CommandField)gridViewForums.Columns[0];
                cmdField.ShowEditButton = false;
                cmdField.ShowDeleteButton = false;
             
                //gridViewForums.SelectedIndex = 0;
                //gridViewForums.DataBind();
            }
        }

        public void ucForumControlSelectedIndexChanged(object sender, EventArgs e)
        {
            Session["ucForum_GridViewForums"] = (GridView)ucForumControl.FindControl("gridViewForums");
            Session["ucForum_SelectedValue"] = ucForumControl.SelectedValue;
            ucForumThreadPosts.SearchForumThreadDataBind();
        }
    }
}